Component({
      properties: {
        // 初始值（可选）
        initialValue: {
          type: String,
          value: ''
        }
      },
      data: {
        value: '',
        submitted: false
      },
      lifetimes: {
        attached() {
          this.setData({
            value: this.data.initialValue || ''
          });
        }
      },
      methods: {
        onInput(e) {
          let t = this.data.submitted;
          console.log(t);
          if (this.data.submitted) return;

          var debounce = function (fn, t) {
            let timeout;
            return function (...args) {
              clearTimeout(timeout);
              timeout = setTimeout(() => {
                fn(...args)
              }, t);
            };
          };
          var that = this;
         let f1 = that.setData({
          value: e.detail.value
        });
          that.debounce(f1,1000);
      },
            onSubmit() {
              if (!this.data.value.trim()) {
                wx.showToast({
                  title: '请输入内容',
                  icon: 'none'
                });
                return;
              }
              this.setData({
                submitted: true
              });
              // 通知父组件
              this.triggerEvent('submit', {
                value: this.data.value
              });
            },
            reSet() {
              this.setData({
                value: '',
                submitted: false
              });
              // 通知父组件
              this.triggerEvent('reSet', {
                value: this.data.value
              }, {
                submitted: this.data.submitted
              });
              console.log('已重置')
            }
        }
      });